<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 先写某一行，这里是内层的循环
        // 循环生成其他行 这里是外层的循环
        // 过早优化是万恶之源 不要一步到位
        var j = 1
        while(j <= 9) {
            var i = 1;
            while(i<=j) {
                document.write(' <span>'+ i+'*'+j+'='+j*i +'</span> ')
                i ++
            }
            document.write('<br />')
            j ++;
        }
    </script>
</body>
</html>